package day05;

public class ForEven {
    public static void main(String[] args) {
        int[] a = {10,20,30,40,50};
        int[] b = new int[6]; //0,0,0,0,0,0
        System.arraycopy(a,0,b,0,4); //灵活性好
        for(int i=0;i<b.length;i++){
            System.out.println(b[i]);
        }

        int[] arr={10,20,30,40,50,60,};
        int[] brr=new int[4];
        System.arraycopy(arr,0,brr,0,4);
        for (int i = 0; i < brr.length; i++) {
            System.out.println(brr[i]);
        }









      /*  for (int i = 1; i < 6; i++) {
            for (int j =0; j < 2*i-1; j++) {
                System.out.print("*");

            }
            System.out.println();
        }

       */

    /*    int sum =0;
        for (int i = 0; i <=100 ; i+=2) {
            sum+=i;
        }
        System.out.println("1到100之间偶数的和为"+sum);
        int sum1=0;
        for (int i = 1; i <=100 ; i+=2) {
            sum1+=i;
        }
        System.out.println("1到100之间奇数的和为"+sum1);

     */

        /*int num = 1; //阶乘
        for(int i=1;i<=8;i++){
            num*=i;
        }
        System.out.println("num="+num);

         */





    }
}
